class StoreStaffSalary < ApplicationRecord
  include SalaryLog

  belongs_to :store
  belongs_to :store_staff

  scope :last_month_salary, ->(month = Time.now.last_month.strftime("%Y%m")) { where(created_month: month) }
  scope :by_created_month, ->(month) { where(created_month: month) }
  scope :by_month, ->(month) { by_created_month(month.strftime("%Y%m")) }
  scope :uncheck, -> { where(status: false) }
  scope :checked, -> { where(status: true) }

  def salary_status
    status
  end

  def basic_salary
    basic
  end

  def salary_id
    id
  end


end
